<?php

namespace app\api\service;

use think\facade\Config;
use think\Service;

class AliService extends Service
{
    public static function AliOauth($code)
    {
        $config  = Config::get('aliapp');
        $result =   Request::httpRequest('http://api.kelimx.com/cgi-bin/ali/miniProgram/auth/session','POST',json_encode([
            'code'=>$code,
            'appAuthToken'=>$config['token']
        ]));
        if($result['code']!=200){
            return $result['msg'];
        }
        return $result['result'];
    }
}